package model.solver;

import model.BasicResult;

/**
 * Represent the result of a solver execution. It provide some useful information as the status of the execution or stdin and stderr.
 * @author stephane
 *
 */
public class SolverResult extends BasicResult {
	public static final String DEFAULT_DESCRIPTION = "Result of the solver";
	public static final SolverResultStatus DEFAULT_STATUS = SolverResultStatus.PROBLEM;
	public static final int UNKNOW_VALUE = -1;
	
	private SolverResultStatus status = DEFAULT_STATUS;
	
	private int restarts = UNKNOW_VALUE; 
	private int conflics = UNKNOW_VALUE;
	private int decisions = UNKNOW_VALUE;
	private int propagations = UNKNOW_VALUE;
	private int conflicLiterals = UNKNOW_VALUE;
	private String solution = null; 
	
	public SolverResult() {
		// TODO Auto-generated constructor stub
		description = DEFAULT_DESCRIPTION;
	}
	
	public String getSolution() {
		return solution;
	}



	public void setSolution(String solution) {
		this.solution = solution;
	}

	public String toString(){
		String res = description+" : \nStatus: "+status+"\n"+"Solving time: "+getPreprocTime()+"\nwith begin at : "+begin+" ; end at :"+end+"\nMemory used : "+memoryUsed;
		
		res += "\nrestarts: "+restarts+"\nconflics: "+conflics+"\ndecisions: "+decisions+"\npropagations: "+propagations+"\nconflict literals: "+conflicLiterals;
		
		if(solution != null)
			res += "\n Solution : "+solution;
		return res;
	}
	
	public SolverResultStatus getStatus() {
		return status;
	}


	public void setStatus(SolverResultStatus status) {
		this.status = status;
	}



	public int getRestarts() {
		return restarts;
	}



	public void setRestarts(int restarts) {
		this.restarts = restarts;
	}



	public int getConflics() {
		return conflics;
	}



	public void setConflics(int conflics) {
		this.conflics = conflics;
	}



	public int getDecisions() {
		return decisions;
	}



	public void setDecisions(int decisions) {
		this.decisions = decisions;
	}



	public int getPropagations() {
		return propagations;
	}



	public void setPropagations(int propagations) {
		this.propagations = propagations;
	}



	public int getConflicLiterals() {
		return conflicLiterals;
	}



	public void setConflicLiterals(int conflicLiterals) {
		this.conflicLiterals = conflicLiterals;
	}






}
